/*  This file is part of CASpp.

    CASpp is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    CASpp is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with CASpp.  If not, see <http://www.gnu.org/licenses/>.

    Copyright 2014 Jérome LAURENS

    See https://code.google.com/p/idalgo/

*/

#if !defined _CASPP_MODELS_REAL_H_
#define _CASPP_MODELS_REAL_H_

#include <caspp/config.h>
#include <boost/multiprecision/mpfr.hpp>
#include <boost/smart_ptr.hpp>
#include "integer.h"
#include "rational.h"

CASPP_NS_BEGIN

namespace Rounding {
    enum Values {
        Nearest=MPFR_RNDN,  /* round to nearest, with ties to even */
        Zero=MPFR_RNDZ,    /* round toward zero */
        Up=MPFR_RNDU,    /* round toward +Inf */
        Down=MPFR_RNDD,    /* round toward -Inf */
        Away=MPFR_RNDA,    /* round away from zero */
        Faithful=MPFR_RNDF,    /* faithful rounding (not implemented yet) */
        NearestAway=MPFR_RNDNA, /* round to nearest, with ties away from zero (mpfr_round) */
        Significant=MPFR_RNDF+100 /* 1.000000000...000x and 0.9999999999...9999x rounded to 1 when expected length is not specified */
    };
}

typedef boost::multiprecision::mpfr_float Real;

typedef boost::shared_ptr<Real> RealRef;

Real makeReal(const Integer & __x);
Real makeReal(const Rational & __x);

CASPP_NS_END

#endif // _CASPP_MODELS_REAL_H_
